package designPattern.command.undoCommand
{
	import flash.text.TextField;

	public class DecrementCommandWithUndo extends CommandWithUndo
	{
		private var receiver:TextField;
		public function DecrementCommandWithUndo(rec:TextField)
		{
			super();
			this.receiver = rec;
		}
		
		override public function execute():void
		{
			receiver.text = (Number(receiver.text) - 1).toString();
			super.execute();
		}
		
		override public function undo():void
		{
			receiver.text = (Number(receiver.text) + 1).toString();
		}
	}
}